package project.taobao.commons.activemq.send.imple;

import org.springframework.jms.core.JmsTemplate;
import project.taobao.commons.activemq.utils.ActiveMqUtils;
import project.taobao.commons.activemq.send.Producer;

import javax.jms.Destination;

public class JmsTemplateProducer implements Producer {
    // methods
    @Override
    public void sendMessage(Destination queue, Object message) {
        JmsTemplate jmsTemplate = ActiveMqUtils.getJmsTemplate();
        try{
            jmsTemplate.convertAndSend(queue,message);
        } catch (Exception e){
            e.printStackTrace();
        }
    }
    // getters, setters

    // constructors
}
